
<style type="text/css">
    .span6 {width:50%;display:inline-block;float:left;}
    .data tr td.tl {text-align:left;background:url(images/tl_bg.gif) 10px no-repeat;text-indent:25px;font-weight: bold;
                    background:url(images/tl_bg_dot.gif) 10px no-repeat;
    }
    .data tr td.tli {background:url(images/tl_bg.gif) 10px no-repeat;font-weight: normal;color:#777;}
    .innertitle a.btn,.innertitle a.btn span {cursor: default;}
</style>
<div class="p-head">
    <b class="c3">账户</b>
    <div class="r">
        <a href="/bbs/index/3/" class="ajax" title="意见反馈">意见反馈</a>
    </div>
    <div id="desc">
        记录每天生活的点点滴滴。。。
    </div>
</div>
<div class="tabs_t tabs_n">
    <ul class="ajax" id="tabs_l">
        <li><a href="/category/">收支分类</a></li>                        
        <li class="current"><a href="/account/">账户管理</a></li>
        <li><a href="/family/">家庭管理</a></li>
        <li><a href="/task/">定时记账</a></li>
    </ul>
    <span class="r clear">
        <a href="/account/add/" title="添加账户" class="btn btn_s dialog" close="true" callback="account_callback"><span><b class="icon icon-edit"></b><em>添加账户</em></span></a>
    </span>
</div>
<div id="account">
    <?php foreach ($account_list as $m => $n) { ?>
        <div class="account_list">
            <div class="innertitle clear">
                <a class="btn btn_g_s btn_d_h" href="javascript:;"><span style="width:65px;"><b class=""></b><em><?= $n['name'] ?></em></span></a>
    <!--                <small>共计 <?= count($n['list']) ?> <?= $n['unit'] ?><?= $n['name'] ?></small>-->
            </div>
            <div class="innerlist clear">
                <?php foreach ($n['list'] as $k => $v) { ?>
                    <div class="itemlist" style="<?= $k == 3 ? "margin-right:0;" : "" ?>">
                        <div class="editarea">
                            <a href="/account/log/<?= $v['id'] ?>/" callback="account_log" class="log dialog" close="true" title="<?= $v['name'] ?>对账">对账</a>
                            <a href="/account/edit/<?= $v['id'] ?>/" callback="account_edit" class="dialog" close="true" title="编辑帐户">编辑</a>
                            <a href="/account/del/<?= $v['id'] ?>/" callback="account_delete" class="del" title="删除帐户">删除</a>
                        </div>
                        <dl>
                            <dt>
                            <?php if ($v['type'] == 'bank' || $v['type'] == 'credit') { ?>
                                <b class="bank"><img src="/res/images/bank/<?= $v['icon'] ?>.png" alt="" /></b>
                                <a href="/bill/?account_id=<?= $v['id'] ?>" title="点击查看账户记账记录" class="ajax"><?= cutstr($v['name'], 12) ?></a>
                            <?php } else { ?>
                                <a href="/bill/?account_id=<?= $v['id'] ?>" title="点击查看账户记账记录" class="ajax"><?= cutstr($v['name'], 14) ?></a>
                            <?php } ?>
                            </dt>
                            <?php if ($v['type'] == 'credit') { ?>
                                <dd><b>本期需要还款</b>：￥<?= $v['balance'] > 0 ? 0 : -$v['balance'] ?></dd>
                                <dd><b>剩余还款天数</b>：<?= date("m") > $v['repaydate'] ? date("m", get_unixtime('month', 1, 'begin', date("Y"), date("m"), date("d"))) + (get_month_days() - date("m")) - $v['repaydate'] : $v['repaydate'] - date("m") ?> 天</dd>
                                <!--                                <dd><b>本月剩余额度</b>：0</dd>-->
                                <dd></dd>
                                <!--                                <dd><a href="/">查消费记录</a> | <a href="/">去还款</a></dd>-->
                            <?php } else { ?>
                                <!--                                <dd><b>记录</b>：0 条</dd>-->
                                <dd><b>币种</b>：CNY</dd>
                                <dd><b>余额</b>：￥<?= $v['balance'] ?></dd>
                            <?php } ?>
                        </dl>
                        <div class="boxbg"></div>
                    </div>
                <?php } ?>
            </div>
        </div>
    <?php } ?>
</div>
<script type="text/javascript">
    KS.common.load('account.index');
</script>